package com.treeman.notification;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.treeman.user.User;

@Entity
@Table(name = "NOTIFICATION")
public class Notification {

	@Id
	@Column(name = "NOTIFICATION_ID")
	@SequenceGenerator(name = "notification_id_gen", sequenceName = "notification_id_sequence", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "notification_id_gen")
	private Long id;

	@Basic(optional = false)
	@ManyToOne(targetEntity = User.class)
	@JoinColumn(name = "TO_USER_ID", nullable = false)
	private User to;

	@Column(name = "MESSAGE")
	private String message;

	@Basic(optional = false)
	@Column(name = "NEW", nullable = false)
	private Boolean isNew = false;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public User getTo() {
		return to;
	}

	public void setTo(User to) {
		this.to = to;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Boolean getIsNew() {
		return isNew;
	}

	public void setIsNew(Boolean isNew) {
		this.isNew = isNew;
	}
}